import { get, post, del, put } from "@/utils/request";
import { type listReturn, type addParams, type addData } from "./type";

// 楼栋列表
export const buildingList = () => {
  return get<null, listReturn>("/api/building/list");
};

// 楼栋添加
export const buildingAdd = (data: addParams) => {
  return post<addParams, addData>("/api/building/add", data);
};

// 楼栋删除
export const buildingDel = (id: number) => {
  return del<number, null>(`/api/building/delete/${id}`);
};

// 修改
export const buildingUpdate = (data: addParams) => {
  return put<addParams, addData>("/api/building/update", data);
};
